duck_hunt.exe: liblcom.a main.o
	gcc -Wall main.o -L. -llcom -o duck_hunt.exe

main.o: main.c video-graphics.c sprite.c jogo.c GQueue.c ints.c rtc.c kbc.c queue.c aux_func.c codepage.c timer.c music.c
	gcc -c -Wall main.c

sprite.o: sprite.h sprite.c
	gcc -c -Wall sprite.c

video-graphics.o: video-graphics.h video-graphics.c
	gcc -c -Wall video-graphics.c

jogo.o: jogo.h jogo.c
	gcc -c -Wall jogo.c

ints.o: ints.h ints.c
	gcc -c -Wall ints.c

rtc.o: rtc.h rtc.c
	gcc -c -Wall rtc.c

GQueue.o: GQueue.h GQueue.c
	gcc -c -Wall GQueue.c
	
queue.o: queue.h queue.c
	gcc -c -Wall queue.c

kbc.o: kbc.h kbc.c Gqueue.h queue.h
	gcc -c -Wall kbc.c

timer.o: timer.h timer.c ints.h
	gcc -c -Wall timer.c

codepage.o: codepage.h codepage.c
	gcc -c -Wall codepage.c
	
music.o: music.h music.c
	gcc -c -Wall music.c
	
kbd_isr.o: kbd_isr.asm
	nasm -t -f coff kbd_isr.asm -o kbd_isr.o

rtc_isr.o: rtc_isr.asm
	nasm -t -f coff rtc_isr.asm -o rtc_isr.o
	
wait.o: wait.asm
	nasm -t -f coff wait.asm -o wait.o

	
liblcom.a: video-graphics.o sprite.o jogo.o ints.o rtc.o rtc_isr.o GQueue.o kbd_isr.o codepage.o wait.o kbc.o queue.o timer.o music.o
	ar -cr liblcom.a video-graphics.o sprite.o jogo.o ints.o rtc.o rtc_isr.o GQueue.o kbd_isr.o codepage.o wait.o kbc.o queue.o timer.o music.o
	
clean: 
	del main.o
	del video-graphics.o 
	del pixmap.o
	del jogo.o
	del ints.o
	del kbc.o
	del music.o
	del timer.o
	del sprite.o
	del queue.o
	del GQueue.o
	del wait.o
	del kbd_isr.o
	del wait.o
	del rtc.o
	del *.exe
	